<?php session_start();
ob_start();
$starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0];

define ('insite', 1);
$allok=0;
require "_sysvol/security.php";
require "opt.php";
if ($config["debug"]==0) error_reporting(0);
require "_sysvol/engine.php";
require "_sysvol/fsql.php";
require "_sysvol/them.php";

$db = new Connect ($config["ctype"], $config["db_host"], $config["db_name"], $config["db_user"], $config["db_upwd"],$config["odbc_driver"],$config["debug"]); 
if ($config["under_rec"]==1)
{
	if (adm_check($_SESSION["user"])!=1)
	{
		echo "<div align='center'><img src='imgs/underC.png' border='0'></div>";
		login("close");
	} else $allok=1;
}
if ($allok==1 or $config["under_rec"]==0) 
{
	if (is_file("theme/".$config["theme"]."/index.php")) 
	{
		if ($config["show_adm"]==0) $show_gm="CtlCode !=32 and"; else $show_gm="";
	
		if ($_POST["selectedchar"]) $_SESSION["character"] = checkword(substr($_POST["selectedchar"],0,10),0);

		require "_sysvol/webv.php";
		require"theme/".$config["theme"]."/index.php";
		$db->close();
		if ($config["gen_time"]==1)
		{
		$mtime = explode(' ', microtime());
		$totaltime = $mtime[0] + $mtime[1] - $starttime;
		printf('<center>Page loaded in %.2f seconds</center>', $totaltime);
		}
	}
	else die("theme file is not found, check your site!");
}
ob_end_flush();
$db->close();
?>
